/*
Audica Uploader - application for convenient uploading to various file hostings
Copyright (C) 2011-2012 Makarov Andrey (Winand)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GLOBAL_H
#define GLOBAL_H
#include <QString>
#include <QDebug>

//if value is not defined return default
//#define defOpt(opt, def) QVariant(opt ? true : def) /*THIS MAKES NO SENSE=)*/
/*//quotes string
#define qu(x) "\"" + x + "\""*/
//check if value /x/ is not out of bounds
#define inBounds(a, x, b) (x >= a && x <= b)
//check if enum /e/ contains /x/, /e/ should be declared with Q_ENUMS
#include <QMetaEnum>
#define inEnum(x, e) (bool)staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator(e)).valueToKey(x)
//script execution max time (ms)
#define TIME_SCRIPT_EXEC 2000
//waiting for /succeeded/ from script
#define TIME_SCRIPT_WAIT 20000

QString appPath();
void customDbgHandler(QtMsgType type, const char *msg);

#endif // GLOBAL_H
